package org.extframework.ld.service;

import java.util.Collection;
import java.util.List;
import java.util.Map;

import org.extframework.ld.bean.Entity;
import org.springframework.orm.hibernate3.HibernateTemplate;

/**
 * @author : Dong.Li
 * @created : 2013-1-17
 * @version : 1.0
 * @description :数据库操作接口
 */
public interface CommDao {
	public abstract <T extends Entity> T get(Class<T> paramClass, Long paramLong);

	public abstract <T extends Entity> T load(Class<T> paramClass,
			Long paramLong);

	public abstract <T extends Entity> List<T> loadAll(Class<T> paramClass,
			Long[] paramArrayOfLong);

	public abstract <T extends Entity> List<T> loadAll(Class<T> paramClass);

	public abstract <T extends Entity> List<T> loadAll(Class<T> paramClass,
			List<Long> paramList);

	public abstract <T extends Entity> void store(T paramT);

	public abstract <T extends Entity> void delete(T paramT);

	public abstract <T extends Entity> void deleteAll(
			Collection<T> paramCollection);

	public abstract void initialize(Object paramObject);

	public abstract void refresh(Object paramObject);

	public abstract List query(String paramString, Map paramMap);
	
	public abstract List findByQueryPage(String paramString1,int satrt,int size);
	
	public abstract List findByQueryPage(String paramString1, String paramString2,
			Object paramObject,int satrt,int size);
	
	public abstract List findByQueryPage(String paramString1, String[] paramString2,
			Object[] paramObject,int satrt,int size);

	public abstract List findByQuery(String paramString1, String paramString2,
			Object paramObject);

	public abstract List findByQuery(String paramString);

	public abstract List findByQuery(String paramString,
			String[] paramArrayOfString, Object[] paramArrayOfObject);

	public abstract Object findByQueryUniqueResult(String paramString,
			String[] paramArrayOfString, Object[] paramArrayOfObject);

	public abstract Object findByQueryUniqueResult(String paramString1,
			String paramString2, Object paramObject);

	public abstract int executeByHql(String paramString,
			String[] paramArrayOfString, Object[] paramArrayOfObject);

	public abstract int executeByHql(String paramString1, String paramString2,
			Object paramObject);

	public abstract HibernateTemplate getHibernateTemplate();
	

}
